<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>后台管理</title>
    <link rel="stylesheet" href="../../res/css/nek-ui.default.css">
    <link rel="stylesheet" href="../../res/css/style.css">
    <style>
        textarea[data-src] {display: none;}
    </style>
</head>
<body>
<div class="g-doc" id="module-box">
    <!-- @MODULE -->
    <textarea name="html" data-src="module/layout/system/index.html"></textarea>
    <textarea name="html" data-src="module/layout/node/index.html"></textarea>
    <textarea name="html" data-src="module/system/crumb/index.html"></textarea>
    <textarea name="html" data-src="module/system/tab/index.html"></textarea>
    <textarea name="html" data-src="module/system/menu/index.html"></textarea>
    <textarea name="html" data-src="module/node/tab/index.html"></textarea>
    <textarea name="html" data-src="module/index/index.html"></textarea>
    <textarea name="html" data-src="module/node/list/index.html"></textarea>
    <!-- /@MODULE -->
</div>


<!-- @VERSION -->
<script>location.config = {root: './'};</script>

<script type="text/javascript" src="../javascript/lib/regular/regular.js"></script>
<script type="text/javascript" src="../javascript/lib/nek-ui/nek-ui.js"></script>

<script src="../javascript/lib/nej/define.js?pro=../javascript/"></script>
<script>
    NEJ.define([
        'util/dispatcher/dispatcher',
        './module/system/crumb/index.js',
        './module/system/tab/index.js',
        './module/system/menu/index.js',
        './module/index/index.js',
        './module/node/list/index.js'
    ], function (dsp,
                 SystemCrumb, SystemTab, SystemMenu,
                 IndexModule,
                 NodeListModule
    ) {
        /* start up dispatcher */
        dsp._$startup({
            rules: {
                "rewrite": {
                    "404": "/m/list/"
                },
                "title": {
                    // 页面标题
                    "/m/list/": "后台首页",
                    '/m/node/list/': '节点列表'
                },
                "alias": {
                    //全局面包屑导航
                    'crumb' : '/?/crumb/',
                    'system-menu' : '/?/menu/',


                    // tabs
                    'tab-system': '/?/tab/',
                    'tab-node': '/?/node/tab/',

                    // layout
                    'layout-system': '/m',
                    'layout-node' : '/m/node',

                    // page
                    "index": "/m/list/",
                    'node-list': '/m/node/list/'
                }
            },
            modules: {
                //全局面包屑导航
                '/?/crumb/' : SystemCrumb,
                '/?/menu/' : SystemMenu,
                // tabs
                '/?/tab/' : SystemTab,
                '/?/node/tab/': 'module/node/tab/index.html',

                // layout and page
                "/m": {
                    "module":"module/layout/system/index.html",
                    "composite":{
                        "tab":"/?/tab/",
                        'crumb': '/?/crumb/',
                        'menu': '/?/menu/'
                    }
                },
                "/m/list/": IndexModule,

                '/m/node': {
                    'module':'module/layout/node/index.html',
                    'composite': {
                        'tab':'/?/node/tab/'
                    }
                },
                '/m/node/list/': NodeListModule
            },
            onbeforechange: function (_options) {
                var _umi = _options.path || '';
                if (!!_umi &&
                    _umi.indexOf('/?') < 0 &&
                    _umi.indexOf('/m') < 0)
                    _options.path = '/m' + _umi;
            }
        });
    });
</script>
</body>
</html>